\documentclass[leqno]{article}
% \documentclass[12pt]{article}

%% Created with wxMaxima 19.01.2x

\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
% \usepackage[utf8]{luainputenc}
\DeclareUnicodeCharacter{00B5}{\ensuremath{\mu}}
\usepackage{graphicx}
\usepackage{color}
\usepackage{amsmath}
\usepackage{ifthen}
\newsavebox{\picturebox}
\newlength{\pictureboxwidth}
\newlength{\pictureboxheight}
\newcommand{\includeimage}[1]{
    \savebox{\picturebox}{\includegraphics{#1}}
    \settoheight{\pictureboxheight}{\usebox{\picturebox}}
    \settowidth{\pictureboxwidth}{\usebox{\picturebox}}
    \ifthenelse{\lengthtest{\pictureboxwidth > .95\linewidth}}
    {
        \includegraphics[width=.95\linewidth,height=.80\textheight,keepaspectratio]{#1}
    }
    {
        \ifthenelse{\lengthtest{\pictureboxheight>.80\textheight}}
        {
            \includegraphics[width=.95\linewidth,height=.80\textheight,keepaspectratio]{#1}
            
        }
        {
            \includegraphics{#1}
        }
    }
}
\newlength{\thislabelwidth}
\DeclareMathOperator{\abs}{abs}
\usepackage{animate} % This package is required because the wxMaxima configuration option
                      % "Export animations to TeX" was enabled when this file was generated.

\definecolor{labelcolor}{RGB}{100,0,0}

\begin{document}


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bf
(\% i2)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
/* HeisenbergModel2.mac */HeisenbergModel2



sx: matrix([0,1],[1,0]);

sx: 1/2*sx;


\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{sx}
\begin{pmatrix}0 & 1\\
1 & 0\end{pmatrix}\mbox{}\]

\[\tag{sx}
\begin{pmatrix}0 & \frac{1}{2}\\
\frac{1}{2} & 0\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bf
(\% i4)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
sy: matrix([0,-\%i],[\%i,0]);

sy: 1/2*sy;


\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{sy}
\begin{pmatrix}0 & -\% i\\
\% i & 0\end{pmatrix}\mbox{}\]

\[\tag{sy}
\begin{pmatrix}0 & -\frac{\% i}{2}\\
\frac{\% i}{2} & 0\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bf
(\% i6)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
sz: matrix([1,0],[0,-1]);

sz: 1/2*sz;


\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{sz}
\begin{pmatrix}1 & 0\\
0 & -1\end{pmatrix}\mbox{}\]

\[\tag{sz}
\begin{pmatrix}\frac{1}{2} & 0\\
0 & -\frac{1}{2}\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bf
(\% i9)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
H: kronecker\_product(sx,sx)+kronecker\_product(sy,sy)+ kronecker\_product(sz,sz);

H: 2*J*H;

print("H=",H);


\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{H}
\begin{pmatrix}\frac{1}{4} & 0 & 0 & 0\\
0 & -\frac{1}{4} & \frac{1}{2} & 0\\
0 & \frac{1}{2} & -\frac{1}{4} & 0\\
0 & 0 & 0 & \frac{1}{4}\end{pmatrix}\mbox{}\]

\[\tag{H}
\begin{pmatrix}\frac{J}{2} & 0 & 0 & 0\\
0 & -\frac{J}{2} & J & 0\\
0 & J & -\frac{J}{2} & 0\\
0 & 0 & 0 & \frac{J}{2}\end{pmatrix}\mbox{}
\]\mbox{}\\H=
 
\[\displaystyle \begin{pmatrix}\frac{J}{2} & 0 & 0 & 0\\
0 & -\frac{J}{2} & J & 0\\
0 & J & -\frac{J}{2} & 0\\
0 & 0 & 0 & \frac{J}{2}\end{pmatrix}\mbox{}
\] 

\[\tag{\% o9} 
\begin{pmatrix}\frac{J}{2} & 0 & 0 & 0\\
0 & -\frac{J}{2} & J & 0\\
0 & J & -\frac{J}{2} & 0\\
0 & 0 & 0 & \frac{J}{2}\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bf
(\% i11)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
r1: eigenvalues(H);

print("r1=",r1);


\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{r1}
[[-\frac{3 J}{2},\frac{J}{2}],[1,3]]\mbox{}
\]\mbox{}\\r1=
 
\[\displaystyle [[-\frac{3 J}{2},\frac{J}{2}],[1,3]]\mbox{}
\] 

\[\tag{\% o11} 
[[-\frac{3 J}{2},\frac{J}{2}],[1,3]]\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bf
(\% i13)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
r2: eigenvectors(H);

print("r2=",r2);


\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{r2}
[[[-\frac{3 J}{2},\frac{J}{2}],[1,3]],[[[0,1,-1,0]],[[1,0,0,0],[0,1,1,0],[0,0,0,1]]]]\mbox{}
\]\mbox{}\\r2=
 
\[\displaystyle [[[-\frac{3 J}{2},\frac{J}{2}],[1,3]],[[[0,1,-1,0]],[[1,0,0,0],[0,1,1,0],[0,0,0,1]]]]\mbox{}
\] 

\[\tag{\% o13} 
[[[-\frac{3 J}{2},\frac{J}{2}],[1,3]],[[[0,1,-1,0]],[[1,0,0,0],[0,1,1,0],[0,0,0,1]]]]\mbox{}
\]
%%%%%%%%%%%%%%%
\end{document}
